package com.zh.kmmsample.android.item

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Card
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.zh.kmmsample.model.WenDaModel

/**
 * 问答条目
 */
@Composable
fun WenDaItem(data: WenDaModel.Data.Datas?, onClick: (data: WenDaModel.Data.Datas?) -> Unit) {
    Card(
        modifier = Modifier
            .background(Color.White)
            .padding(10.dp)
            .fillMaxWidth()
            .clickable {
                onClick.invoke(data)
            },
        elevation = 10.dp
    ) {
        Column(modifier = Modifier.padding(10.dp)) {
            Text(
                text = "作者${data?.author}"
            )
            Text(text = "${data?.title}")
        }
    }
}